<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

/**
 * Settings Model
 *
 * @package     VisualQ Local System
 * @author      CSU OJT Students '10 - '11
 * @copyright   Copyright (c) 2010 - 2011, Bitstop Network Services, Inc.
 * @version     0.1b January 17, 2011
 */

class Settings_model extends Model {

    function Settings_model()
    {
        parent::Model();
        $this->load->database();

        $this->CI =& get_instance();
    }

    function get_branch_id()
    {
        $this->db->select('value');
        $this->db->where('name', 'branch_id');
        return $this->db->get('settings');
    }

    function get_company_id()
    {
        $this->db->select('value');
        $this->db->where('name', 'client_id');
        return $this->db->get('settings');
    }

    function check_settings()
    {
        $query = $this->db->get('settings');
        return $query->num_rows();
    }

    function check_services()
    {
        $query = $this->db->get('services');
        return $query->num_rows();
    }

    function check_accounts()
    {
        $query = $this->db->get('accounts');
        return $query->num_rows();
    }

    function check_accounts_services()
    {
        $query = $this->db->get('accounts_services');
        return $query->num_rows();
    }

}

/* End of file settings_model.php */
/* Location: ./system/application/model/settings_model.php */